<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition template="/WEB-INF/layout/layout.xhtml"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
>

	<ui:define name="title">List All</ui:define>

	<ui:define name="primary">

	<p:messages />

	<h:form id="form1">

		<p:panel>
			<p:dataTable id="listAll" paginator="true" rows="15" rowsPerPageTemplate="15,50,100,1000" value="#{listAllDataTable.attrs}" var="attr" >

				<p:column>
					<h:outputText value="#{attr.id}"/>
				</p:column>

				<p:column filterBy="#{attr.description}" filterMatchMode="contains">
                                        <h:outputText value="#{attr.description}"/>
                                </p:column>

				<p:column>
					<p:commandLink ajax="true" oncomplete="confirmDelete.show()" >
						<h:outputText value="Delete" />
					</p:commandLink>
				</p:column>

			</p:dataTable>
		</p:panel>

		<p:confirmDialog message="Are you sure about deleting this ?" showEffect="bounce" hideEffect="explode"  header="Initiating destroy process" severity="alert" widgetVar="confirmDelete">  
			<p:commandButton value="Yes I am 100% sure" update="messages" oncomplete="confirmDelete.hide()"  action="#{listAllDataTable.delete}" ajax="false" />  
			<p:commandButton value="Cancel" onclick="confirmDelete.hide()" type="button" />   
		</p:confirmDialog>
	</h:form>
	</ui:define>
</ui:composition>
